﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
namespace MyWeb.Data
{
	public class tblImgAlbumDAL : SqlDataProvider
	{

		#region[tblImgAlbum_GetbyAll]
		public DataTable tblImgAlbum_GetByAll()
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_GetByAll", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgAlbum_GetbyId]
		public DataTable tblImgAlbum_GetById(tblImgAlbumInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_GetById", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_iaid", Data._iaid));
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgAlbum_GetbyTop]
		public DataTable tblImgAlbum_GetByTop(string Top, string Where, string Order)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_GetByTop", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				cmd.Parameters.Add(new SqlParameter("@Top",Top));
				cmd.Parameters.Add(new SqlParameter("@Where",Where));
				cmd.Parameters.Add(new SqlParameter("@Order",Order));
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgAlbum_Getby_uid]
		public DataTable tblImgAlbum_GetBy_uid(string _uid)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_GetBy_uid", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_uid", _uid));
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgAlbum_Insert]
		public void tblImgAlbum_Insert(tblImgAlbumInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_Insert", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_uid", Data._uid));
				cmd.Parameters.Add(new SqlParameter("@_ianame", Data._ianame));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
		#region[tblImgAlbum_Update]
		public void tblImgAlbum_Update(tblImgAlbumInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_Update", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_uid", Data._uid));
				cmd.Parameters.Add(new SqlParameter("@_iaid", Data._iaid));
				cmd.Parameters.Add(new SqlParameter("@_ianame", Data._ianame));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
		#region[tblImgAlbum_Delete]
		public void tblImgAlbum_Delete(string Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgAlbum_Delete", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_iaid", Data));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
	}
}